﻿
@{

    var src = ViewBag.src;
    var isLocked = ViewBag.isLocked;
    var id = ViewBag.id;
    Layout = null;

}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <link href="~/Content/Css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="~/Content/Css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="~/Content/Css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    <link href="~/Content/Css/animate.css" rel="stylesheet">

    <link href="~/Content/Css/style.css?v=4.1.0" rel="stylesheet">
    <link href="~/Content/Css/plugins/bootstrap-fileinput/fileinput.min.css" media="all" rel="stylesheet" type="text/css" />
    <title>查看外勤考勤图片</title>
    <link href="~/Scripts/plugins/jcrop1902/css/jquery.Jcrop.min.css" rel="stylesheet" />
    <style>
        .ibox-content {
            padding:0px;
        }
         /*.col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12,
        .col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12,
        .btn-group,div {
            border-style: solid;
            border-width: 1px;
            border-color: #000;
        }*/
        #submit {
            margin-top:20px;
            margin-right:20px;
        }
    </style>
</head>
<body>
    <div class="wrapper wrapper-content animated fadeInRight">

        <div class="row">
            <div class="col-sm-12"> 
                    <div class="ibox-content layer-photos-demo" id="layer-photos-demo"> 
                        <a href="#" title="图片1">
                            <img alt="image" src="@src" style="width:420px;height:500px;" />
                        </a> 
                    </div> 
            </div>
            @if (isLocked == "1")
            {
                <input type="hidden" id="IsLocked" name="IsLocked" value="0" />
                <input type="hidden" id="id" name="id" value="@id" />
                <div>
                    <button id="submit" class="btn btn-danger pull-right" type="submit">
                        <i class="fa fa-times"></i>&nbsp;无&nbsp;效
                    </button>
                </div>
            }
            else
            {
                <input type="hidden" id="IsLocked" name="IsLocked" value="1" />
                <input type="hidden" id="id" name="id" value="@id" />
                <div>
                    <button id="submit" class="btn btn-primary pull-right" type="submit">
                        <i class="fa fa-check"></i>&nbsp;有&nbsp;效
                    </button>
                </div>
            }
           
        </div>

    </div>

    <!-- 全局js -->
    <script type="text/javascript" src="~/Scripts/jquery.min.js?v=2.1.4"></script>
    <script type="text/javascript" src="~/Scripts/bootstrap.min.js?v=3.3.6"></script>

    <!-- layer javascript -->
    <script type="text/javascript" src="~/Scripts/plugins/layer/layer.min.js"></script>

    <!-- bootstrap-fileinput -->
    <script type="text/javascript" src="~/Scripts/plugins/bootstrap-fileinput/fileinput.min.js"></script>
    <script type="text/javascript" src="~/Scripts/plugins/bootstrap-fileinput/locales/zh.js"></script>
    @*<script src="~/Scripts/plugins/bootstrap-fileinput/fileinput.js"></script>*@

    <!-- jQuery Validation plugin javascript-->
    <script type="text/javascript" src="~/Scripts/plugins/validate/jquery.validate.min.js"></script>
    <script type="text/javascript" src="~/Scripts/plugins/validate/messages_zh.min.js"></script>
    <script type="text/javascript" src="~/Scripts/Extensions/ExtValidator.js"></script>
    <script src="~/Scripts/plugins/jcrop1902/js/jquery.Jcrop.min.js"></script>
    <script src="~/Scripts/plugins/jcrop1902/js/jquery.color.js"></script>
    <script>
        $(function () {
            // validate signup form on keyup and submit
            var icon = "<i class='fa fa-times-circle'></i> ";
            var validator = $("#mainForm").validate({
                rules: { 
                },
                messages: { 
                },
                submitHandler: function (form) {
                    //进行ajax传值
                    $.ajax({
                        url: "/QandA/InsertProblemAsync",
                        type: "post",
                        dataType: "json",
                        data: $('#mainForm').serialize(),
                        success: function (data) {
                            //Info,Success,Warning,Error
                            var type = data.type;
                            if (type == 1) {
                                layer.msg(data.content, { icon: 6, time: 2000 },
                                    function () {
                                        var index = parent.layer.getFrameIndex(window.name);
                                        parent.layer.close(index);
                                    });

                            } else {
                                layer.msg(data.content, { icon: 5, time: 2000 });
                            }
                        }
                    });
                }
            });
        });
    </script>

</body>

</html>
